From 07a47e68364d55a2f5b428f8af6ece65345aab7f Mon Sep 17 00:00:00 2001 From: "sos22@donkeykong.cl.cam.ac.uk" Date: Wed, 28 Jul 2004 16:18:34 +0000 Subject: [PATCH] bitkeeper revision 1.1098.1.2 (4107d1daarfb__XMoCtKug7vXc1-4w) Random tidy-ups. --- xen/Rules.mk | 2 +- xen/arch/x86/Rules.mk | 10 ++++++++-- xen/arch/x86/xdb.c | 20 +++++--------------- xen/common/kernel.c | 5 ----- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index 6073e113c2..af8399e5a4 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -43,7 +43,7 @@ CFLAGS += -DNDEBUG endif ifeq ($(debugger),y) -CFLAGS += -DXEN_DEBUGGER +CFLAGS += -DXEN_DEBUGGER -g endif ifeq ($(perfc),y) diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 2ecca1fffe..257fffedc3 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -4,8 +4,8 @@ CC := gcc LD := ld -CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3 -CFLAGS += -iwithprefix include -Wall -Werror -fomit-frame-pointer -pipe +CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing +CFLAGS += -iwithprefix include -Wall -Werror -pipe CFLAGS += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls ifeq ($(TARGET_SUBARCH),x86_32) @@ -13,6 +13,12 @@ CFLAGS += -m32 -march=i686 LDFLAGS := --oformat elf32-i386 endif +ifeq ($(debugger),y) +CFLAGS += -O2 +else +CFLAGS += -O3 -fomit-frame-pointer +endif + ifeq ($(TARGET_SUBARCH),x86_64) CFLAGS += -m64 -mno-red-zone -fpic -fno-reorder-blocks CFLAGS += -fno-asynchronous-unwind-tables diff --git a/xen/arch/x86/xdb.c b/xen/arch/x86/xdb.c index 8548953108..8074e12fd7 100644 --- a/xen/arch/x86/xdb.c +++ b/xen/arch/x86/xdb.c @@ -40,17 +40,7 @@ hex_char_val(unsigned char c) return c - 'A' + 10; else BUG(); -} - -static unsigned char -val_to_hex_char(unsigned val) -{ - if (val < 10) - return val + '0'; - else if (val < 16) - return val - 10 + 'a'; - else - BUG(); + return -1; } /* Receive a command. Returns -1 on csum error, 0 otherwise. */ @@ -344,11 +334,11 @@ __trap_to_xendbg(struct pt_regs *regs) return; } xendbg_running = 1; - /* trap_to_xendbg gets esp slightly wrong. Correct for this. */ - regs->esp += 8; - dbg_printk("Waiting for GDB to attach to XenDBG\n"); - /* Urgg... hope this is right... */ + /* Shouldn't really do this, but otherwise we stop for no + obvious reason, which is Bad */ + printk("Waiting for GDB to attach to XenDBG\n"); + while (resume == 0) { r = receive_command(recv_buf); if (r < 0) { diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 0864c9fab7..cfebb1daad 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -112,7 +112,6 @@ static struct { void initialize_xendbg(void); -void trap_to_xendbg(void); void cmain(multiboot_info_t *mbi) { @@ -299,10 +298,6 @@ void cmain(multiboot_info_t *mbi) shadow_mode_init(); - printk("Trapping to debugger.\n"); - trap_to_xendbg(); - printk("Trapped to debugger and came back.\n"); - /* * We're going to setup domain0 using the module(s) that we stashed safely * above our heap. The second module, if present, is an initrd ramdisk. -- 2.30.2